
var moveSpeed = 1.0;
var scrollSpeed = 10;
var hSpeed:float = 10;
var vSpeed:float = 10;
var mR:Array = new Array(-50,50,-25,25,0,100);

function Update () {
	var newPosition:Vector3 = transform.position;
	
	newPosition.y += Input.GetAxis("Mouse ScrollWheel") * Time.deltaTime * scrollSpeed;
	
	
	if(Input.GetButton("left")){
		newPosition.x -= Time.deltaTime * moveSpeed;
	}
	if(Input.GetButton("right")){
		newPosition.x += Time.deltaTime * moveSpeed;
	}
	if(Input.GetButton("forward")){
		newPosition.z += Time.deltaTime * moveSpeed;
	}
	if(Input.GetButton("backward")){
		newPosition.z -= Time.deltaTime * moveSpeed;
	}
	
	newPosition.x = Mathf.Clamp(newPosition.x, mR[0], mR[1]);
	newPosition.z = Mathf.Clamp(newPosition.z, mR[2], mR[3]);
	newPosition.y = Mathf.Clamp(newPosition.y, mR[4], mR[5]);
	transform.position = newPosition;
	
	if(Input.GetButton("Fire1") && Input.GetKey("left alt")){
		var heightValue:float = transform.position.y;
		var h : float = hSpeed * Input.GetAxis ("Mouse X");
		var v : float = vSpeed * Input.GetAxis ("Mouse Y");
		transform.Translate (h, v, 0);
		transform.position.y = heightValue;
	}
}